POV-Ray : Newsgroups : povray.advanced-users : Frustration!! : Re: Frustration!! Server Time
1 Jul 2024 05:38:34 EDT (-0400)
  Re: Frustration!!  
From: Lioness
Date: 15 Aug 2009 11:45:01
Message: <web.4a86d6eebe92e5065a751fb0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:
> #if statements are resolved during the Parse phase of the processing, so
> you can say things like
>   #if(Val1(0,0,0) > Val2(0,0,0))
> Which causes one of the two functions to be chosen at parse time
> depending on the colour of a particular point specified at parse time,
> then used for every point of the resulting pigment.
>
>
> "select" statements are resolved at run time, so you can use them to
> examine each point and choose the corresponding function depending on
> the values of the images at that point. The syntax gets a bit
> convoluted:
>
> #declare OverlayRed =
> pigment
> {
>     function { select ((Image1(x,y,z).gray - Image2(x,y,z).gray)
>                  ,
>                ((1-Image1(x,y,z).red)*(1-Image2(x,y,z).red)/1)
>                  ,
>                ((Image1(x,y,z).red)*Image2(x,y,z).red/1)
>                )
>              }
>     colour_map{[0 rgb 0][1 rgb <2,0,0>] }
> }
>
> --
> Mike Williams
> Gentleman of Leisure

I'm really not the sharpest tool in the box today. Maybe I should go back to
sleep, so I can't do anymore damage....

Chris: Yeah, I spotted the spare bracket, it's gone now ... that's exactly what
I had in mind and I know it doesn't work that way. I was just trying stuff out
with my usual chaotic approach. Thanks for your solution, it works!

Mike: Oooooooooooo! I've never used 'select' before! How ingenius! I'm gonna try
it at once... (if Britain explodes within the next half hour, you know why :-)

All your help and suggestions are much appreciated, gentlemen! Thank you!

Caz


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.